package gui;

import java.awt.BorderLayout;
import javax.swing.JPanel;
import kontroler.Kontroler;

@SuppressWarnings("serial")
public class WestPanel extends JPanel{

	private JPanel upperPanel = null;
	private JPanel lowerPanel = null;
	private CompetitionSplitPane compSplitPane = null;
	private Kontroler kontroler = null;
	
	public WestPanel(Kontroler kontroler) {
		super(new BorderLayout());
		this.kontroler = kontroler;
		initialize();
	}
	
	private void initialize() {
		this.add(getUpperPanel(),BorderLayout.NORTH);
		this.add(getLowerPanel(),BorderLayout.SOUTH);
	}
	private JPanel getUpperPanel() {
		if (upperPanel == null){
			upperPanel = new JPanel();
			upperPanel.add(getCompSplitPane());
		}
		return upperPanel;
	}
	private JPanel getLowerPanel() {
		if (lowerPanel == null){
			lowerPanel = new JPanel();
		}
		return lowerPanel;
	}
	public CompetitionSplitPane getCompSplitPane() {
		if (compSplitPane == null){
			compSplitPane = new CompetitionSplitPane(kontroler);
		}
		return compSplitPane;
	}
	public Kontroler getKontroler(){
		return kontroler;
	}
	public String getSelectedCountryValue(){
		return compSplitPane.getSelectedCountryValue();
	}
	
}
